package com.tongji.housediy.model
{
	/**
	 * 
	 * @author songjia
	 * 
	 */
	import com.tongji.housediy.vo.User;
	
	import flash.net.SharedObject;
	
	import mx.collections.ArrayCollection;
	import mx.controls.Alert;
	
	import org.robotlegs.mvcs.Actor;
	
	[Bindable]
	public class UserInforModel extends Actor
	{
		public var userID:String = '';
		public var userName:String = '';
		
		public var userType:ArrayCollection = new ArrayCollection();
		
		public var currentTypeID:int = 0;
		
		public var currentDesignID:int = 0;
		public var isLogined:Boolean = false;
		
		public function UserInforModel()
		{
			var userType1:User = new User();
			userType1.userType = "普通用户";
			
			var userType2:User = new User();
			userType2.userType = "楼盘管理员";
			
			userType.addItem(userType1);
			userType.addItem(userType2);
			super();
		}
		public function updateUserInfor(userID:String, userName:String):void
		{
			this.userID = userID;
			this.userName =userName;
			//Alert.show("ID"+this.UserID+"  "+"用户名"+this.UserName);
		}
		
		public function updateUser(userID:String):void
		{
			this.userID = userID;
		}
		
		public function checkLogin():Boolean
		{
			var sharedObject:SharedObject = SharedObject.getLocal("User");
			if(userID != "")
				return true;
			return false;
		}
	}
}